home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 631 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: Rezonet.net!news
  2. From: ray@ultimate-tech.com (Ray Dunn)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Problem with stringcopy
  5. Date: 8 Jan 1996 05:17:47 GMT
  6. Organization: Ultimate Technographics Inc.
  7. Message-ID: <4cq9dr$if9@ns.RezoNet.NET>
  8. References: <4clguu$9fs@eagle.novo.dk> <820933963snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: 204.19.230.7
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.7
  13.  
  14. In referenced article, Lawrence Kirby says...
  15. >Morten Brun writes:
  16. >
  17. >>How do i do a partial stringcopy i.e. copy from a specific position 
  18. >>in a string and a certain numbers of bytes. I am looking for a 
  19. >>function like target = Stringcopy(source, startpos, length)
  20. >
  21. >target[0] = '\0';
  22. >strncat(target, source+startpos, length);
  23.  
  24. ...but use strncpy if you are overwriting some existing characters in 
  25. target and don't want the target string to terminate after the copied 
  26. characters.
  27. -- 
  28. Ray Dunn (opinions are my own) | Phone: (514) 938 9050
  29. Montreal                       | Phax : (514) 938 5225
  30. ray@ultimate-tech.com          | Home : (514) 630 3749
  31.  
  32.